<include file='Index/header'/>
<style>
    .input1{
       width:80px; 
        
    }
    .input2{
        
       width:40px; 
        
    }
     .input3{
        
       width:100px; 
        
    }   
</style>
  <script language="javascript" type="text/javascript" src="__PUBLIC__/My97DatePicker/WdatePicker.js"></script>  
<include file='Index/left'/>

    <div class="content">
        
        <div class="header">
            
            <h1 class="page-title">数据导入</h1>
        </div>
        
                <ul class="breadcrumb">
            <li><a href="{:U('Index/Index')}">首页</a> <span class="divider">/</span></li>
            <li class="active">学员信息导入</li>
        </ul>
<div class="well well-sm">学员信息导入</div>
        <div class="container-fluid">
            <div class="row-fluid">  
                <div>          
                    
<form action="__CONTROLLER__/Upload/fs/xy" method="post" enctype="multipart/form-data">
    <input name="photo" type="file" value=""  style="width:400px"/>
    <input type='hidden' name='bcbh' value="{$bcbh}"/>
    <input type="submit" value="上传" name=""/>
</form>
            
                </div>
      <hr />     
     <div id="form">
         <if condition="$data neq ''">
             
<form id="form1" name="form1" method="post" action="">
<table width="943" border="1" style="text-align:center">
  <tr>
      <td colspan="11"><strong><h2>学员名单 </h2></strong></td>
  </tr>
    <tr>
      <td width="16" nowrap="nowrap">序号</td>
      <td width="16" nowrap="nowrap">姓名</td>
      <td width="16" nowrap="nowrap">性别</td>
      <td width="16" nowrap="nowrap">民族</td>
      <td width="16" nowrap="nowrap">单位及职务</td>
      <td width="16" nowrap="nowrap">电话</td>
      <td width="16" nowrap="nowrap">身份证号</td>
	  <td width="16">级别</td>
      <td width="40">备注</td>
    </tr>
   <input type="hidden" name="classid2" value="{$bcbh}"/>
        <volist name='data' id='vo'>
            <if condition="$vo['loginname'] neq ''">
                <tr>
      <td nowrap="nowrap">&nbsp;</td>
      <td nowrap="nowrap"><input type="hidden" name="classid[]" value="{$bcbh}"/>
          <input type="text" name="loginname[]" id="loginname" class='input1' value='{$vo.loginname}' /></td>
      <td nowrap="nowrap"><input type="text" name="sex[]" id="sex" class='input2' value='{$vo.sex}'/></td>
      <td nowrap="nowrap"><input type="text" name="nation[]" id="nation" class='input2' value='{$vo.nation}'/></td>
      <td nowrap="nowrap"><input type="text" name="Company[]" id="Company"  class='input1' value='{$vo.Company}'/></td>
      <td nowrap="nowrap"><input type="text" name="telephone[]" id="telphone" class='input3' value='{$vo.telphone}'/></td>
      <td nowrap="nowrap"><input type="text" name="IDcard[]" id="IDcart" value='{$vo.IDcard}' class='input1'/></td>
	  <td><input type="text" name="level[]" id="level" value='{$vo.level}'/></td>
      <td><input type="text" name="remark[]" id="remark" value='{$vo.remark}'/></td>
             </tr>
            </if>
        </volist>
   
  <tr><td colspan="11">   <button type="button" class="btn-primary btn-lg btn-block" onclick="tj()">提交信息</button></td></tr>
</table>
</form>
         </if>
     </div>
   <script type="text/javascript">  
function tj(){

   $.ajax({
                type: "POST",
                url: "__CONTROLLER__/Xueyuanadmin",          
                cache: false,
                data: $('#form1').serialize(),
                success: function(data) {
                switch(data){
                case '0':
                    alert('导入成功');
     window.location.replace("__CONTROLLER__/PeixunList") 
                break;
                case '1': 
                 alert('添加失败，请检查表单项');
           
                break;
        case '3':
                alert('学员编号已存在');
                break;
            default:
                alert(data);
        }
                       }
        })

    
}
</script>
                    
<include file='Index/footer'/>
